<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
require 'dbcon.php';

$sql_wz="select * from posts";
$result=$db->query($sql_wz);//执行
$bbsdata=$result->fetch_all(MYSQLI_ASSOC);
$wz_num=$result->num_rows;//计算总数

$sql_cg="select * from posts where status='drafted'";
$result=$db->query($sql_cg);//执行
$bbsdata=$result->fetch_all(MYSQLI_ASSOC);
$cg_num=$result->num_rows;

$sql_fl="select * from categories ";
$result=$db->query($sql_fl);//执行
$bbsdata=$result->fetch_all(MYSQLI_ASSOC);
$fl_num=$result->num_rows;

$sql_pl="select * from comments ";
$result=$db->query($sql_pl);//执行
$bbsdata=$result->fetch_all(MYSQLI_ASSOC);
$pl_num=$result->num_rows;

$sql_sh="select * from comments where status='held'";//判断总数
$result=$db->query($sql_sh);//执行
$bbsdata=$result->fetch_all(MYSQLI_ASSOC);
$sh_num=$result->num_rows;

$result->free_result();
$db->close();//关闭数据库连接
require 'index_html.php';
